import pyautogui
from pyautogui import size
from pyautogui import position
from pyautogui import moveTo
from pyautogui import click
from pyautogui import screenshot
from pyautogui import locateOnScreen
import schedule
import time


def job(text=""):
    z, h = position()
    print(z, h)
    click(1168, 940, button='left')
    print(text, "I'm working...")


x, y = size()
# z, h = position()
print(x, y)

# moveTo(90, 26, duration=4)
# click(90, 26, button='left')
# screenshot().save('1.png')
# print(locateOnScreen('1.png'))
crmbtn = pyautogui.locateOnScreen('crm.png')
print(crmbtn.left)
crmbtn_point =pyautogui.center(crmbtn)
print(crmbtn_point.x)
print(crmbtn_point.y)
pyautogui.doubleClick(crmbtn_point.x, crmbtn_point.y)
schedule.every().day.at("20:00").do(job)
while True:
    schedule.run_pending()
    time.sleep(0.1)
